From: Carlos Garnacho Date: Mon, 17 Oct 2022 11:31:45 +0000 (+0200) Subject: keyboard: Synchronize input method state after toggling completion X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~435^2^2~9 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b2f2266199e0fc0e2d89a9a2e05d7b740dabfe6a;p=gnome-shell.git keyboard: Synchronize input method state after toggling completion Make the input method synchronize its state after the engine changes resulting from completion being toggled. Part-of: --- diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js index d9335cc81..07c177b81 100644 --- a/js/misc/inputMethod.js +++ b/js/misc/inputMethod.js @@ -352,4 +352,15 @@ var InputMethod = GObject.registerClass({ return false; } } + + update() { + if (!this._context) + return; + this._updateCapabilities(); + this._context.set_content_type(this._purpose, this._hints); + this._context.set_cursor_location( + this._cursorRect.x, this._cursorRect.y, + this._cursorRect.width, this._cursorRect.height); + this._emitRequestSurrounding(); + } }); diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 3241571de..a158425a6 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1893,7 +1893,7 @@ var Keyboard = GObject.registerClass({ } this._oskCompletionEnabled = - IBusManager.getIBusManager().setCompletionEnabled(true); + IBusManager.getIBusManager().setCompletionEnabled(true, () => Main.inputMethod.update()); this._clearKeyboardRestTimer(); if (immediate) { @@ -1928,7 +1928,7 @@ var Keyboard = GObject.registerClass({ if (!this._keyboardVisible) return; - IBusManager.getIBusManager().setCompletionEnabled(false); + IBusManager.getIBusManager().setCompletionEnabled(false, () => Main.inputMethod.update()); this._oskCompletionEnabled = false; this._clearKeyboardRestTimer();